#include <iostream>
using namespace std;

int reverse(int number) {
  int result = 0;
  while (number != 0) {
    int remainder = number % 10;

    result = result * 10 + remainder;

    number = number / 10;
  }

  return result;
}

int main()
{
  cout << reverse(12345) << endl;

  return 0;
}
